// Generate a HTML table
// By Ben 11:06 03/10/2018

#include <iostream>
using namespace std;

int main(){

	int rows = 4;
	int cols = 4;
	int x = 0;
	int y = 0;
	bool m_border = true;
	string s_row = "";

	//Check if we are adding a border to the table
	if(m_border){
		//Add border
		s_row.append("<table border=\"1\">\n");
	}else{
		//No border
		s_row.append("<table>\n");
	}
	//Add table body
	s_row.append("  <tbody>\n");

	//Create the rows and cols for the HTML table
	for(y=0;y<rows;y++){
		//Append row
		s_row.append("   <tr>\n");
		for(x = 0;x<cols;x++){
			//Append row data
			s_row .append("     <td>Data</td>\n");	
		}
		//Append end of row
		s_row.append("   </tr>\n");
	}
	//Append end of table body and table
	s_row.append("  </tbody>\n");
	s_row.append("</table>\n");
	
	//Write out HTML table code
	std::cout << s_row.c_str();

	//Clear up.
	s_row.clear();

	return 0;
}